//////////////////////////////////////////////////
// glSceneSpatial.cpp
//
// Author: Tarik Belabbas et Adrien Hoffer
//////////////////////////////////////////////////

#include "glSceneSpatial.h"

//------------------------------------------------------------------------------
glSceneSpatial::glSceneSpatial()
{
	m_parent		= NULL;
	m_localScale	= 1.0f;
	m_worldScale	= 1.0f;
}

//------------------------------------------------------------------------------
glSceneSpatial::~glSceneSpatial()
{

}

//------------------------------------------------------------------------------
void glSceneSpatial::updateWorldTransform()
{
	if ( m_parent )
	{
		m_worldScale = m_parent->m_worldScale * m_localScale;
		m_worldRotate = m_parent->m_worldRotate * m_localRotate;
		m_worldTranslate = m_parent->m_worldTranslate + m_parent->m_worldScale
				* m_parent->m_worldRotate * m_localTranslate;
	}
	else
	{
		m_worldScale = m_localScale;
		m_worldRotate = m_localRotate;
		m_worldTranslate = m_localTranslate;
	}
}
